package com.hn.gege;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

//import org.springframework.security.config.annotation.web.builders.HttpSecurity;

@RestController
@SpringBootApplication
public class GegeApplication {
    public static void main(String[] args) {
        SpringApplication.run(GegeApplication.class);
    }


//    @Autowired
//    HttpSecurity httpSecurity;

//    @ApiOperation("测试")
//    @GetMapping("/clear")
//    public String clear(String name) throws Exception {
//        httpSecurity.csrf()// 由于使用的是JWT，我们这里不需要csrf
//                .disable().authorizeRequests()
//                .antMatchers(HttpMethod.GET,
//                        "/aa").permitAll();
//        return "成功";
//    }


    @PostMapping("/q/test")
    public String testAa(@RequestBody Map map) {
        System.out.println(map.toString());
        return "hello word";
    }

    @GetMapping("/q/test")
    public String testGet(Map map) {
        System.out.println(map.toString());
        return "hello word";
    }


}
